import IO.Buffered;
import javafx.scene.input.DataFormat;

import java.io.BufferedReader;
import java.text.SimpleDateFormat;

/**
 * @author wuhan
 * @date 2019/10/8 19:51
 */
public class Date {
    public static void main(String[] args) {
        java.util.Date d=new java.util.Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd E hh:mm:ss");
        String format = sdf.format(d);
        System.out.println(format);

        System.out.println(saveLastTwoBit(123.278234));
    }

    /**
     * 四舍五入保留两位小数
     * @param d
     * @return
     */
    private static double saveLastTwoBit(double d){
        d=  (double) Math.round(d*100)/100;
        return d;
    }
}

